<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Hot Topic @ Twitter</title>

    <!-- Bootstrap -->
    <link href="../bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <link href="../bootstrap-3.3.5/datetime/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <!-- Custom styles for this template -->
    <link href="../css/custom.css" rel="stylesheet">
    <link href="../vis/vis.css" rel="stylesheet">
    
  </head>
  <body>
    <nav class="navbar navbar-inverse" style="margin-bottom:0">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index.html">Hot Topic @Twitter</a>
       </div>
       <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="index.html">Hot Topic</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Sample 
                <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li class="dropdown-header">Sample Analysis</li>
                <li><a href="degree.html">Degree Distribution</a></li>
                <li><a href="like.html">Twitter Like</a></li>
                <li><a href="follow.html">Follow Who</a></li>
              </ul>
            </li>
            <li><a href="contact.html">Contact</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
    
    
    <br/>
	<div class="container" style="padding: 10px 15px 0;">
		<div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">2015-10-31 Top#1 Halloween</h3>
            </div>
      	</div>
	</div>
	<br/>
   
	<div class="container">
		<div class="col">
		    <div class="panel panel-info row-sm-3">
                <div class="panel-heading">
                    <h3 class="panel-title">Frequency By Hour</h3>
                </div>
                <div class="panel-body">
                    <div>
                        <canvas id="linechart_hour" style=" max-height: 300px;height: auto !important;"></canvas>
                    </div>
                </div>
            </div>
		
      		<div class="panel panel-info row-sm-3">
            	<div class="panel-heading">
              		<h3 class="panel-title">Frequency Cycle</h3>
            	</div>
            	<div class="panel-body">
            		<div>
              			<canvas id="linechart" style=" max-height: 300px;height: auto !important;"></canvas>
            		</div>
            	</div>
      		</div>
        	
			<br/>
			
        	<div class="panel panel-info ">
				<div class="panel-heading">
					<h3 class="panel-title">Hot Twitter</h3>
				</div>
				<div class="panel-body row-sm-6">
              		<div id="networkchart" style="height:400px;"></div>
            	</div>
			</div>
			
			
     	</div>
		
	</div><!-- /container -->
	
	
	<footer class="footer">
      <div class="container">
        <p class="text-muted" align="center">
            &copy; Project For CMSC5733 Social Computing 2015 @CUHK
        </p>
      </div>
    </footer>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!-- <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="../bootstrap-3.3.5/js/bootstrap.min.js"></script>

    <!-- Charts ======================================================================================= -->
    
    <!-- Network Chart -->
    <script src="../vis/vis.js"></script>
    <script type="text/javascript">
    var nodes = null;
    var edges = null;
    var network = null;

    function drawnetwork() {
      // create people.
      // value corresponds with the age of the person
      nodes = [
        {id: 1,  value: 50,  label: 'Halloween' },
        {id: 2150348149,  value: 20, label: '2150348149'},
        {id: 2596708050,  value: 10, label: '2596708050' },
        {id: 1187647735,  value: 20, label: '1187647735' },
        {id: 279113402,  value: 10, label: '279113402'},
        {id: 1352586948,  value: 20,  label: '1352586948'},
        {id: 1522759688,  value: 10,  label: '1522759688'},
        {id: 255780074,  value: 10, label: '255780074'},
        {id: 1129966621, value: 10, label: '1129966621'},
        {id: 2906590051, value: 10, label: '2906590051'}
      ];

      // create connections between people
      // value corresponds with the amount of contact between two people
      edges = [
        {from: 2150348149, to: 1, value: 2, title: '5830592 times'},
        {from: 2596708050, to: 2150348149, value: 1, arrows:'to', title: '1 time'},
        {from: 1187647735, to: 1, value: 2, title: '17864 times'},
        {from: 279113402, to: 1187647735, value: 1, arrows:'to', title: '1 time'},
        {from: 1352586948, to: 1, value: 2, title: '169718 times'},
        {from: 1522759688, to: 1352586948, value: 1, arrows:'to', title: '1 time'},
        {from: 255780074, to: 1352586948, value: 1, arrows:'to', title: '1 time'},
        {from: 1129966621, to: 1352586948, value: 1, arrows:'to', title: '1 time'},
        {from: 2906590051, to: 1352586948, value: 1, arrows:'to', title: '3 time'}
      ];

      // Instantiate our network object.
      var container = document.getElementById('networkchart');
      var data = {
        nodes: nodes,
        edges: edges
      };
      var options = {
        nodes: {
          shape: 'dot',
          scaling:{
            label: {
              min:8,
              max:20
            }
          }
        }
      };
      
      network = new vis.Network(container, data, options);
    }
    
    
  	</script>
  	
  	<!-- Line Chart -->
    <script src="../Chart.js.1.2/Chart.js"></script>
    <script type="text/javascript">
    var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
    var lineChartData_hour = {
        labels : ["00",
                  "01","02","03","04","05","06","07",
                  "08","09","10","11","12","13","14",
                  "15","16","17","18","19","20","21",
                  "22","23"
                  ],
        datasets : [
            {
                label: "Frequency",
                fillColor : "rgba(151,187,205,0.2)",
                strokeColor : "rgba(151,187,205,1)",
                pointColor : "rgba(151,187,205,1)",
                pointStrokeColor : "#fff",
                pointHighlightFill : "#fff",
                pointHighlightStroke : "rgba(151,187,205,1)",
                data : [22852,
                        10544,27872,18331,56965,39506,25801,983,
                        250,1822,133758,793574,202639,48274,51613,
                        31169,214301,43159,104544,73682,217860,32470,
                        13030,302680
                        ]
            }
        ]

    }
    
	var lineChartData = {
		labels : ["2015-10-01","2015-10-02","2015-10-03","2015-10-04","2015-10-05","2015-10-06","2015-10-07",
		          "2015-10-08","2015-10-09","2015-10-10","2015-10-11","2015-10-12","2015-10-13","2015-10-14",
		          "2015-10-15","2015-10-16","2015-10-17","2015-10-18","2015-10-19","2015-10-20","2015-10-21",
		          "2015-10-22","2015-10-23","2015-10-24","2015-10-25","2015-10-26","2015-10-27","2015-10-28",
		          "2015-10-29","2015-10-30","2015-10-31"
		          ],
		datasets : [
			{
				label: "Frequency",
				fillColor : "rgba(151,187,205,0.2)",
				strokeColor : "rgba(151,187,205,1)",
				pointColor : "rgba(151,187,205,1)",
				pointStrokeColor : "#fff",
				pointHighlightFill : "#fff",
				pointHighlightStroke : "rgba(151,187,205,1)",
				data : [0,0,0,0,70032,0,0,
		                0,0,0,0,0,0,0,
		                0,0,0,0,0,0,0,
		                0,0,0,0,0,128346,205303,
		                193450,383504,2469197]
			}
		]

	}

	window.onload = function(){
		
		drawnetwork();
		var ctx = document.getElementById("linechart_hour").getContext("2d");
        window.myLine = new Chart(ctx).Line(lineChartData_hour, {
            responsive: true,
            maintainAspectRatio: true
        });
		var ctx = document.getElementById("linechart").getContext("2d");
		window.myLine = new Chart(ctx).Line(lineChartData, {
			responsive: true,
		    maintainAspectRatio: true
		});
	}

    </script>
    
	<script src="../vis/googleAnalytics.js"></script>
    
  </body>
</html>
